package com.huluobo.a2112mvvmdouyindemo.home;

import androidx.lifecycle.MutableLiveData;

import com.huluobo.mvvm_base.bean.HomeTabBannerBeanResult;
import com.huluobo.mvvm_base.bean.HomeVideoBeanResult;
import com.huluobo.mvvm_base.viewmodel.BaseViewModel;

/**
 * Created by LC on 2024/3/25.
 */
public class HomeViewModel extends BaseViewModel<HomeRepo> {
    MutableLiveData<HomeVideoBeanResult> getHomeVideoSuccess = new MutableLiveData<>();
    MutableLiveData<String> getHomeVideoFailed = new MutableLiveData<>();
    MutableLiveData<HomeTabBannerBeanResult> getHomeBannerSuccess = new MutableLiveData<>();
    MutableLiveData<String> getHomeBannerFailed = new MutableLiveData<>();

    public void getHomeBanner() {
        repo.getHomeBanner(getHomeBannerSuccess, getHomeBannerFailed);
    }

    public void getHomeVideoList(
            int currentPage,
            int pageSize
    ) {
        repo.getHomeVideoList(currentPage, pageSize, getHomeVideoSuccess, getHomeVideoFailed);
    }

    @Override
    protected HomeRepo createRepo() {
        return new HomeRepo();
    }
}
